//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Windows;
using System.Windows.Data;

namespace OpenLS.UI.Internals
{
    class FormattingConverter : IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values[0] == DependencyProperty.UnsetValue)
                return "";
            var va = (double)values[0];
            var format = (string)values[1];
            return string.Format(format, va);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}